#include "grid.h"
#include <QPainter>

Grid::Grid()
{
    rect = new QRectF();
    setZValue(0);
}

QRectF Grid::boundingRect() const
{
    return *rect;
}

void Grid::paint(QPainter *painter,
               const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    painter->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::SquareCap));
    painter->setRenderHint(QPainter::Antialiasing, true);

    painter->drawText(-2,0,"1"); painter->drawText(28,0,"2"); painter->drawText(58,0,"3");
    painter->drawText(88,0,"4"); painter->drawText(118,0,"5"); painter->drawText(148,0,"6");
    painter->drawText(178,0,"7"); painter->drawText(208,0,"8"); painter->drawText(238,0,"9");
    painter->drawText(266,0,"10"); painter->drawText(296,0,"11"); painter->drawText(326,0,"12");
    painter->drawText(356,0,"13"); painter->drawText(386,0,"14"); painter->drawText(416,0,"15");
    painter->drawText(446,0,"16"); painter->drawText(476,0,"17"); painter->drawText(506,0,"18"); painter->drawText(536,0,"19");

    painter->drawText(-24,23,"A"); painter->drawText(-24,53,"B"); painter->drawText(-24,83,"C");
    painter->drawText(-24,113,"D"); painter->drawText(-24,143,"E"); painter->drawText(-24,173,"F");
    painter->drawText(-24,203,"G"); painter->drawText(-24,233,"H"); painter->drawText(-24,263,"J");
    painter->drawText(-24,293,"K"); painter->drawText(-24,323,"L"); painter->drawText(-24,353,"M");
    painter->drawText(-24,383,"N"); painter->drawText(-24,413,"O"); painter->drawText(-24,443,"P");
    painter->drawText(-24,473,"Q"); painter->drawText(-24,503,"R"); painter->drawText(-24,533,"S"); painter->drawText(-24,563,"T");
}
